// Domien Nowicki
#include "QtLaserActivateAnimation.h"

QtLaserActivateAnimation::QtLaserActivateAnimation(): laser(0), targetCellX(0), targetCellY(0)
{
}

QtLaserActivateAnimation::QtLaserActivateAnimation(const QtLaserActivateAnimation& rhs): QtAnimationCommand(rhs), laser(rhs.laser), targetCellX(rhs.targetCellX), targetCellY(rhs.targetCellY)
{
}

QtLaserActivateAnimation::~QtLaserActivateAnimation()
{
}

void QtLaserActivateAnimation::SetLaser(QtLaserSprite* receiver, unsigned int cellX, unsigned int cellY)
{
	laser = receiver;
	targetCellX = cellX;
	targetCellY = cellY;
}

void QtLaserActivateAnimation::Execute()
{
	if (laser)
	{
		laser->SetLaserDestination(targetCellX, targetCellY);
		laser->Shoot();
	}
}

QtAnimationCommand* QtLaserActivateAnimation::Clone() const
{
	return new QtLaserActivateAnimation(*this);
}
